Postmortem Debugging

Windows NT only: When a program crashes (for example, after a general-protection fault), the system automatically invokes a debugger that is specified in the registry. To make WinDbg be that debugger, use REGEDT32.EXE to edit the following registry key:

HKEY_LOCAL_MACHINE
    SOFTWARE
        Microsoft
            Windows NT
                      CurrentVersion
                                  AeDebug

Add or edit the Debugger value entry (REG_SZ). Give it the following string value:

windbg -p %ld -e %ld

 

You can also use the Attach command from the Run menu to debug a process that is already running.